﻿<controls:ChildWindow x:Class="CalculationDemo.WaterDistribution"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
    xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
    xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"         
    mc:Ignorable="d"
    Width="1200" Height="850" 
    d:DesignHeight="300" d:DesignWidth="400">

    <Grid x:Name="LayoutRoot" Background="White">
        
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="20*"/>
            <ColumnDefinition Width="80*"/>
        </Grid.ColumnDefinitions>
        
        <StackPanel>
            <sdk:DataGrid ItemsSource="{Binding UnitListForTest}" AutoGenerateColumns="False" Loaded="DataGrid_Loaded">
                <sdk:DataGrid.Columns>
                    <sdk:DataGridTextColumn Header="Name"       Binding="{Binding UnitName}"  />
                    <sdk:DataGridTextColumn Header="C"   Binding="{Binding Capacity}"  />
                    <sdk:DataGridTextColumn Header="EC"         Binding="{Binding EffectiveCapacity}"  />
                    <sdk:DataGridTextColumn Header="RC"         Binding="{Binding RealCapacity}"  />
                    
                </sdk:DataGrid.Columns>
            </sdk:DataGrid>

            <!--<TextBlock Text="CalculateDate"  Margin="2,20,0,2"/>
            <TextBox Name="CalculateDate"  Width="150" Margin="2,10,0,2"/> 

            <Button Content="CalculateEC" Click="CalculateEC" Width="150" Margin="0,20,0,0"></Button>

            <Button Content="CalculateDistribution"  Click="CalculateDistribution"  Width="150" Margin="0,20,0,0"></Button>-->

            <TextBlock Text="C  : Capacity"                 FontWeight="Bold" FontSize="12" Margin="2,20,0,2"/>
            <TextBlock Text="EC : Effective Capacity"       FontWeight="Bold" FontSize="12" Margin="2,5,0,0"/>
            <TextBlock Text="DC : Distributed Capacity"     FontWeight="Bold" FontSize="12" Margin="2,5,0,0"/>
        </StackPanel>
        
        <telerik:RadDiagram Grid.Column="1" x:Name="fieldDiagram">

            <telerik:RadDiagramShape x:Name="Radial2" Content="Radial2"  Position="800,300"
                                     Background="LightGreen" Width="100" Height="70"  FontWeight="Bold"
                                     Geometry="{telerik:CommonShape ShapeType=EllipseShape}">               
            </telerik:RadDiagramShape>

            <telerik:RadDiagramConnection StrokeThickness="4" TargetCapType="Arrow1Filled" 
                                          Source="{Binding ElementName=Radial2}" Target="{Binding ElementName=Tower11}" />
            <telerik:RadDiagramShape x:Name="Tower11" Content="Tower11"
                                     Width="100" Background="LightGreen" FontWeight="Bold" Position="550,300" />
            <telerik:RadDiagramConnection x:Name="Well111" Content="Well111" StrokeThickness="1"                                          
                                          Source="{Binding ElementName=Well111t}" Target="{Binding ElementName=Tower11}" />
            <telerik:RadDiagramShape x:Name="Well111t" Content=""
                                     Background="LightGreen" Width="10" Height="10"  FontWeight="Bold"
                                     Geometry="{telerik:CommonShape ShapeType=EllipseShape}"
                                     Position="590,450">
            </telerik:RadDiagramShape>


            <telerik:RadDiagramConnection x:Name="Pipeline21" Content="Pipeline21" StrokeThickness="2"                                          
                                          Source="{Binding ElementName=Tower11}" Target="{Binding ElementName=Tower21}"
                                          TargetCapType="Arrow1Filled" />
            <telerik:RadDiagramShape x:Name="Tower21" Content="Tower21"
                                     Width="100" Background="LightGreen" FontWeight="Bold" Position="400,200" />
            <telerik:RadDiagramConnection x:Name="Well211" Content="Well211" StrokeThickness="1"                                          
                                          Source="{Binding ElementName=Well211t}" Target="{Binding ElementName=Tower21}" />
            <telerik:RadDiagramShape x:Name="Well211t" Content=""
                                     Background="LightGreen" Width="10" Height="10"  FontWeight="Bold"
                                     Geometry="{telerik:CommonShape ShapeType=EllipseShape}"
                                     Position="400,20">
            </telerik:RadDiagramShape>
            <telerik:RadDiagramConnection x:Name="Well212" Content="Well212" StrokeThickness="1"                                          
                                          Source="{Binding ElementName=Well212t}" Target="{Binding ElementName=Tower21}" />
            <telerik:RadDiagramShape x:Name="Well212t" Content=""
                                     Background="LightGreen" Width="10" Height="10"  FontWeight="Bold"
                                     Geometry="{telerik:CommonShape ShapeType=EllipseShape}"
                                     Position="500,100">
            </telerik:RadDiagramShape>


            <telerik:RadDiagramConnection x:Name="Pipeline22" Content="Pipeline22" StrokeThickness="2"                                          
                                          Source="{Binding ElementName=Tower21}" Target="{Binding ElementName=Tower31}"
                                          TargetCapType="Arrow1Filled" />
            <telerik:RadDiagramShape x:Name="Tower31" Content="Tower31"
                                     Width="100" Background="LightGreen" FontWeight="Bold" Position="100,200" />
            <telerik:RadDiagramConnection x:Name="Well311" Content="Well311" StrokeThickness="1"                                          
                                          Source="{Binding ElementName=Well311t}" Target="{Binding ElementName=Tower31}" />
            <telerik:RadDiagramShape x:Name="Well311t" Content=""
                                     Background="LightGreen" Width="10" Height="10"  FontWeight="Bold"
                                     Geometry="{telerik:CommonShape ShapeType=EllipseShape}"
                                     Position="100,20">
            </telerik:RadDiagramShape>


            <telerik:RadDiagramConnection x:Name="Pipeline23" Content="Pipeline23" StrokeThickness="2"                                          
                                          Source="{Binding ElementName=Tower11}" Target="{Binding ElementName=Tower41}"
                                          TargetCapType="Arrow1Filled" />
            <telerik:RadDiagramShape x:Name="Tower41" Content="Tower41"
                                     Width="100" Background="LightGreen" FontWeight="Bold" Position="300,400" />
            <telerik:RadDiagramConnection x:Name="Well411" Content="Well411" StrokeThickness="1"                                          
                                          Source="{Binding ElementName=Well411t}" Target="{Binding ElementName=Tower41}" />
            <telerik:RadDiagramShape x:Name="Well411t" Content=""
                                     Background="LightGreen" Width="10" Height="10"  FontWeight="Bold"
                                     Geometry="{telerik:CommonShape ShapeType=EllipseShape}"
                                     Position="300,520">
            </telerik:RadDiagramShape>
            <telerik:RadDiagramConnection x:Name="Well412" Content="Well412" StrokeThickness="1"                                          
                                          Source="{Binding ElementName=Well412t}" Target="{Binding ElementName=Tower41}" />
            <telerik:RadDiagramShape x:Name="Well412t" Content=""
                                     Background="LightGreen" Width="10" Height="10"  FontWeight="Bold"
                                     Geometry="{telerik:CommonShape ShapeType=EllipseShape}"
                                     Position="400,600">
            </telerik:RadDiagramShape>

        </telerik:RadDiagram>
               
    </Grid>
</controls:ChildWindow>
